var number = 0;	
$(function(){
	
	//给出提示的函数
	var tips = $(".validateTips");
	function updateaddTips(t) {
		tips.text(t).addClass('ui-state-highlight');
		
		setTimeout(function() {
			tips.removeClass('ui-state-highlight',1000);
		}, 500);
	};	
	$("#editLeader").click(function(){	
		var leader = $("input[name='radio']:checked").val();		//负责人id
		var nodeId = $("#deptId").val();							//部门id
		//alert(leader);
		var url="/ag/lwc/designLeader_OAContact.action";
		var req={treeNodeId:nodeId,leader:leader};
		var ajax=jQuery.post(url,req,function (data)
			{
			if((typeof data.message) == "undefined")
					data = eval("("+data+")");
				if(data.message=="success")
				{
					$("#msgdialog").text(data.message);
					$("#msgdialog").dialog("open");
					setTimeout(function() {
						window.location.href="/ag/lwc/findOAContactByDept_OAContact.action?treeNodeId="+nodeId;
					}, 1500);
					
				}
			});
		
	});
	//操作结果的提示框
	$("#msgdialog").dialog({
		autoOpen : false,
	/*	height :50,*/
		width : 40,
		resizable: false,
		modal : true,
		buttons : {
		
			'确定' : function() 
			{
				
				$(this).dialog('close');
				
				
			}
			
		},
		close : function()
		{
		
			
			
		}
	});

});
	